package net.schastny.shopmanager.domain;

import java.util.List;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.IndexColumn;



@Entity
@Table(name = "baseorders")
public class BaseOrder {
    @Id
    @Column(name = "baseorder_id")
    @GeneratedValue
    private Integer baseorderId;
    
	@Column(name = "snbaseorder")
    private String snBaseOrder;   	

    @Column(name = "statusbaseorder")
    private String statusBaseOrder;   	      

    @Column(name = "invoice")
    private String invoice;      
    
    @Column(name = "totalamount")
    private Float totalAmount;   
    
    @Column(name = "comission")
    private Float comission;   

    @Column(name = "ship")
    private Float ship;   
    
    @Column(name = "delivery")
    private Float delivery;   

    @Column(name = "ispaid")
    private Boolean isPaid;   

    @Column(name = "shopid")
    private Integer shopId;   
 
    @Column(name = "usercreated")
    private String usercreated;   
    
    @Column(name = "created")
    private String created;   
    
   
    @OneToMany(cascade={CascadeType.ALL})
    @JoinColumn(name="baseorder_id")
    @IndexColumn(name="idx")
    private List<Order> orders;
    
    
    public List<Order> getOrders() {
		return orders;
	}

	public void setOrders(List<Order> orders) {
		this.orders = orders;
	}

	public String getUsercreated() {
		return usercreated;
	}

	public void setUsercreated(String usercreated) {
		this.usercreated = usercreated;
	}

	public Integer getBaseorderId() {
		return baseorderId;
	}

	public void setBaseorderId(Integer baseorderId) {
		this.baseorderId = baseorderId;
	}

	public String getSnBaseOrder() {
		return snBaseOrder;
	}

	public void setSnBaseOrder(String snBaseOrder) {
		this.snBaseOrder = snBaseOrder;
	}

	public String getStatusBaseOrder() {
		return statusBaseOrder;
	}

	public void setStatusBaseOrder(String statusBaseOrder) {
		this.statusBaseOrder = statusBaseOrder;
	}

	public String getInvoice() {
		return invoice;
	}

	public void setInvoice(String invoice) {
		this.invoice = invoice;
	}

	public Float getTotalAmount() {
		return totalAmount;
	}

	public void setTotalAmount(Float totalAmount) {
		this.totalAmount = totalAmount;
	}

	public Float getComission() {
		return comission;
	}

	public void setComission(Float comission) {
		this.comission = comission;
	}

	public Float getShip() {
		return ship;
	}

	public void setShip(Float ship) {
		this.ship = ship;
	}

	public Float getDelivery() {
		return delivery;
	}

	public void setDelivery(Float delivery) {
		this.delivery = delivery;
	}

	public Boolean getIsPaid() {
		return isPaid;
	}

	public void setIsPaid(Boolean isPaid) {
		this.isPaid = isPaid;
	}



	public String getCreated() {
		return created;
	}
	
	public Integer getShopId() {
		return shopId;
	}

	public void setShopId(Integer shopId) {
		this.shopId = shopId;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		String str = "BaseorderId="+this.getBaseorderId() + "::SnBaseOrder="+this.getSnBaseOrder()+"::Invoice="+this.getInvoice();
		return str;
	}

	
}
